<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>vue中CSS动画原理</title>
	<script type="text/javascript" src="../js/vue.js"></script>
	<style type="text/css">
		.v-enter,
		.v-leave-to {
			opacity: 0;
		}
		.v-enter-active,
		.v-leave-active {
			transition: opacity 3s
		}
	</style>
</head>
<body>
	<div id="app">
		<transition>
		<div v-if="show">Hello Vue.js</div>
		</transition>
		<button @click="change">转换</button>
	</div>
	<script type="text/javascript">
		var vm = new Vue({
			el: '#app',
			data: {
				show: true
			},
			methods: {
				change: function() {
					this.show = !this.show
				}
			}
		})
	</script>
</body>
</html>